# Maintainer: Evgeniy Alekseev <arcanis at archlinux dot org>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Colin Arnott

pkgname=purple-skypeweb
_pkgname=skypeweb
_parentname=skype4pidgin
pkgver=1.7
pkgrel=4
arch=('loong64' 'x86_64')
license=('GPL3')
pkgdesc="SkypeWeb Plugin for Pidgin"
url="https://github.com/EionRobb/skype4pidgin/tree/master/skypeweb"
depends=('libpurple' 'json-glib')

source=("$pkgname-$pkgver.tar.gz"::"https://github.com/EionRobb/$_parentname/archive/$pkgver.tar.gz"
        "make-the-opid-stage-optional.patch")
sha256sums=('e504d4c4807a45aa6ab1c62509c2f31a97952bbf2f0501428fd32a885b2ad84e'
            'a2b1c581bb287a456ba1926d877b174de0fc022dc350ddef4bed03e49d073de9')

prepare() {
    cd "$srcdir/$_parentname-$pkgver"
    # Make the opid stage optional
    # https://github.com/EionRobb/skype4pidgin/commit/91b0d8a6114c66bf291ca8142c2ee2df12d3923a
    patch -Np1 -i ../make-the-opid-stage-optional.patch
}

build() {
    cd "$srcdir/$_parentname-$pkgver/$_pkgname"
    make
}

package() {
    cd "$srcdir/$_parentname-$pkgver/$_pkgname"
    make DESTDIR="$pkgdir" install
}
